import axios from '../AxiosConfig.js'

//{"configure":".*","write":".*","read":".*"}
export const createPermission = data => {
  return axios({
    method: 'put',
    url: '/api/permissions/' + encodeURIComponent(data.vhost) +'/' + data.username,
    data: data
  })
}

export const deletePermission = data => {
  return axios({
    method: 'delete',
    url: '/api/permissions/' + encodeURIComponent(data.vhost) +'/' + data.user,
  })
}

export const selectPermission = data => {
  return axios({
    method: 'get',
    url: '/api/permissions/' + encodeURIComponent(data.vhost) +'/' + data.username,
  })
}

export const listPermission = () => {
  return axios({
    method: 'get',
    url: '/api/permissions'
  })
}


